using System.Reflection;

namespace SBPweb.Forge.Collections
{
    /// <summary>
    /// Class of Version
    /// </summary>
    public class Version
    {

        private static string name;
        private static System.Version version;

        static Version()
        {
            Initialize();
        }

        protected static void Initialize()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            AssemblyName asmName = new AssemblyName(asm.FullName);
            name = asmName.Name;
            version = asmName.Version;
        }

        /// <summary>
        /// Constructor of Version
        /// </summary>
        protected Version()
        {

        }

        /// <summary>
        /// Name of version
        /// </summary>
        public static string Name
        {
            get
            {
                return name;
            }
        }

        /// <summary>
        /// File version
        /// </summary>
        public static System.Version FileVersion
        {
            get
            {
                return version;
            }
        }

        public override string ToString()
        {
            return string.Format("{0}, {1}", Name, FileVersion);
        }

    }

}